package com.lninl.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class CommonController {

    /**
     * 本站链接，调试用
     *
     * @param model
     * @return
     */
    @RequestMapping("/site-urls")
    public String siteUrls(final ModelMap model) {
        return "site-urls";
    }

    public String head(Model model) {
        model.addAttribute("nav", "<a href=\"a\">");
        return "T";
    }

    @RequestMapping("/content")
    public String showFrag(final ModelMap model) {
        model.addAttribute("products", "a");
        return "forget :: content";
    }

    @RequestMapping("/showContentPart")
    public String showContentPart(final ModelMap model) {
        model.addAttribute("content", "a");
        return "content-part";
    }

    @RequestMapping(value = "/test/{view}", method = RequestMethod.GET)
    public String test(@PathVariable("view") String view) {
        return "test/"+view;
    }

}
